//员工管理接口
import request from '@/utils/request'

// 获取用户列表
export function GetEmployees(params) {
    return request({
      url: '/users',
      method: 'get',
      params
    })
  }
  //获取用户数量---分页
  export function GetEmployeesList() {
    return request({
        url: '/users/count',
        method: 'get',
      })
  }
  //新建用户(注册)
  export function addEmployees(data) {
    return request({
        url: '/auth/local/register',
        method: 'post',
        data
      })
  }
  //获取指定用户
  export function getroles(id) {
    return request({
        url: '/users/'+ id,
      })
  } 
  //编辑用户  //给员工分配角色
  export function editEmployees(data) {
    return request({
        url: '/users/'+ data.id,
        method:'put',
        data
      })
  }
  //删除
  export function delEmployees(id) {
    return request({
        url: '/users/'+ id,
        method:'DELETE',
      })
  }
  //获取角色列表
  export function getRoleList() {
    return request({
        url: '/roles',
      })
  } 
  //
  export function getRolesById(id) {
    return request({
        url: '/users/'+ id,
        method:'get',
      })
  }